package com.itjeffrey.autocode.bo.req;

import com.alibaba.fastjson.JSONArray;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.itjeffrey.autocode.common.PageForm;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @From: Jeffrey
 * @Date: 2020/12/29
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MockInterfaceBO extends PageForm<MockInterfaceBO> implements Serializable {

    private static final long serialVersionUID = -473822524813229711L;

    private Integer id;

    /**
     * 接口名称
     */
    @NotNull(message = "接口名称禁止为空！")
    private String itfName;

    /**
     * 接口路径
     */
    @NotNull(message = "接口路径禁止为空！")
    @Length(max = 225, message = "接口路径长度超过最大限值！")
    private String itfUrl;

    /**
     * 请求方式
     */
    @NotNull(message = "请求方式禁止为空！")
    private String itfMethod;

    /**
     * 响应参数格式
     */
    @NotNull(message = "响应参数格式禁止为空！")
    private JSONArray respParams;

    /**
     * 创建时间
     */
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createTime;

    /**
     * 更新时间
     */
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date updateTime;
}
